package com.example.mobile2021606158zl0510;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link com.example.mobile2021606158zl0510.UserFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class UserFragment extends Fragment {

    // TODO: Rename parameter arguments, choose names that match
    // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
    private static final String ARG_PARAM1 = "param1";
    private static final String ARG_PARAM2 = "param2";

    // TODO: Rename and change types of parameters
    private String mParam1;
    private String mParam2;
    private ImageView imageView;
    private TextView tvMainUser;
    private TextView tvMainName;
    private TextView tvMainGender;
    private TextView tvMainPhone;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_user, container, false);
        initView(view);
        return view;
    }
    @Override
    public void onStart() {
        super.onStart();
        tvMainUser.setText("用户名：ZL123456");
        tvMainName.setText("姓 名：  曾龙");
        tvMainGender.setText("性 别：  男");
        tvMainPhone.setText("手 机：16607610614");
    }

    private void initView(View view) {
        imageView = (ImageView) view.findViewById(R.id.imageView);
        tvMainUser = (TextView) view.findViewById(R.id.tv_main_user);
        tvMainName = (TextView) view.findViewById(R.id.tv_main_name);
        tvMainGender = (TextView) view.findViewById(R.id.tv_main_gender);
        tvMainPhone = (TextView) view.findViewById(R.id.tv_main_phone);
    }
}